<%@ page language="java" import="java.util.*"
	import="com.yb.util.comm.RequestUtil,com.yb.domain.member.TsSysuser,com.yb.util.comm.Contants;"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>-幸福兄弟-幸福兄弟拼购网</title>
		<meta name="description"
			content="幸福兄弟盐城拼购第一网www.9898sj.com是幸福兄弟营销策划有限公司旗下品牌项目。幸福兄弟盐城拼购第一网是专门针对建材、家具、电器进行同城拼购的一个网站。将全城千万消费者聚拢在一起，用量来获得最低的购买价格。网站聚集了全城1000个知名优质品牌，消费者足不出户就能完成对盐城建材、家具、电器市场进行最深刻的了解，通过拼购网购买是免费的，消费者不需要花一分钱就能实现最省钱、省心、舒心的购买。幸福兄弟盐城拼购第一网将帮助1000个优质品牌企业最大程度的宣传全城，帮助品牌企业好的口碑得到良好的传播，从而实现最好的销售。希望幸福兄弟盐城拼购第一网能为您的幸福生活、您的成功带来帮助！幸福生活，从拼购开始。公司地址，盐城市南城河路9号（迎宾桥北桥头东侧）；联系电话：0515-88175689  88175528" />
		<meta name="keywords"
			content="幸福兄弟，幸福兄弟盐城拼购第一网，幸福兄弟拼购，幸福兄弟拼购网，盐城拼购，盐城拼购，盐城建材拼购，盐城家具拼购，盐城电器拼购，建材拼购，家具拼购，电器拼购" />

		<link rel="Shortcut Icon" type="image/x-icon"
			href="<%=basePath%>resource/img/favicon.ico" media="screen" />
		<link href="<%=basePath%>resource/css/css.css" rel="stylesheet"
			type="text/css" />
		<style type="text/css">
</style>
		<script src="<%=basePath%>resource/js/jquery-1.4.2.js"></script>
		<script language="javascript">
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}

function InitSwitchObj() {
	IMGLIST = $("#IMG_UL_LIST_1");
	IMGINDEX = $("#IMG_INDEX_UL_LIST_1");
	MAXINDEX = IMGLIST.find("li").length;
	currIndex = 0;
	currImgIndex = IMGINDEX.find("li:eq(" + currIndex + ")");
	currImgLi = IMGLIST.find("li:eq(" + currIndex2 + ")");
	currImgLi.show();
	interValTime = 3000;
	fadeInTime = 800;
	fadeOutTime = 1000;
	ImageAutoSwitch();
	ImageManualSwitch();
	ImageStopSwitch();
}


        //執行時間
var interValTime = 0;
        //下一張圖片顯示時間
var fadeInTime = 0;
        //上一張圖片的消失時間
var fadeOutTime = 0;
        //保存當前圖片定時的對象
var imageTimer = null;
        //當前的索引
var currIndex = null;
var currIndex2 = null;
        //當前圖片的所以
var currImgIndex = null;
var currImgIndex2 = null;
        //當前圖片
var currImgLi = null;
var currImgLi2 = null;
        //記錄需要切換的圖片集合
var IMGLIST = null;
var IMGLIST2 = null; 
        //記錄需要切換的圖片集合的索引。
var IMGINDEX = null;
var IMGINDEX2 = null;
        //最大圖片個數
var MAXINDEX = null;
var MAXINDEX2 = null;
        //自動定時切換。
function ImageAutoSwitch() {
	if (imageTimer != null) {
		clearInterval(imageTimer);
	}
	imageTimer = setInterval("IntervalImage()", interValTime);
}
        //手動切換圖片
function ImageManualSwitch() {
	IMGINDEX.find("li").each(function (i) {
		$(this).hover(function () {
			if (imageTimer != null) {
				clearInterval(imageTimer);
			}
			currIndex = i;
			ImageSwitchChange();
		}, function () {
			ImageAutoSwitch();
		});
	});
}
        //鼠標放到圖片上的換，停止切換
function ImageStopSwitch() {
	IMGLIST.find("li").each(function () {
		$(this).hover(function () {
			if (imageTimer != null) {
				clearInterval(imageTimer);
			}
		}, function () {
			ImageAutoSwitch();
		});
	});
}
        //自动切换图片
function IntervalImage() {
	currIndex = parseFloat(currIndex);
	currIndex = currIndex + 1;
            //如果切換到最大數量的時候則從頭開始
	if (currIndex >= MAXINDEX) {
		currIndex = 0;
	}
            //將原來的現實圖片索引的背景透明
	ImageSwitchChange();
}
        //切換圖片的時候，響應的圖片要實現漸變效果
function ImageSwitchChange() {
	if (currImgIndex != null) {
		currImgIndex.css({"background-color":"transparent"});
	}
	currImgIndex = IMGINDEX.find("li:eq(" + currIndex + ")");
	imgLi = IMGLIST.find("li:eq(" + currIndex + ")");
	currImgIndex.css({"background-color":"#999999"});
	if (currImgLi != null) {
		currImgLi.fadeOut(fadeOutTime, function () {
			imgLi.fadeIn(fadeInTime);
		});
	}
	currImgLi = imgLi;
}

function addfavorite()
{
    window.external.addFavorite('http://www.9898sj.com','幸福兄弟')  ;
} 



var initFlag = true;
function bulidPagnation(totalcount,limit,page,id,renderId,nowId,endId){
	var previewPageStr = '<span class="disabled">&lt;</span>';
	var nextPageStr = '<span><a href="#?page=2">&gt;</a></span>';
	var currentPageStr = '<span class="current">1</span>';
	var showPageStr = '<a href="#?page=2">2</a>';
	var totalPages = (totalcount + limit - 1) / limit;
	var startPage = nowId;
	var endPage = startPage+4;
	if(page>=4)
		if((page - nowId)>=3){
			startPage = page - 2;
			endPage = startPage + 4;
		} 
	if(nowId != 1)
		if((endId-page)>=3){
			startPage = page - 2;
			endPage = startPage + 4;
		}
	if(endPage > totalPages){
		endPage = totalPages;
		nextPageStr = '<span class="disabled">&gt;</span>';
	}else{
		nextPageStr = '<a href="javascript:bulidPagnation('+totalcount+','+limit+','+(page+1)+',\''+id+'\',\''+renderId+'\','+startPage+','+endPage+')">&gt;</a>';
	}
	if(startPage > 1){
		previewPageStr = '<a href="javascript:bulidPagnation('+totalcount+','+limit+','+(page-1)+',\''+id+'\',\''+renderId+'\','+startPage+','+endPage+')">&lt</a>';
	}
	var str = previewPageStr;
	for(var i = startPage;i <= endPage; i++){
		if(i == page)
			str += '<span class="current">'+i+'</span>';
		else
			str += '<a href="javascript:bulidPagnation('+totalcount+','+limit+','+(i)+',\''+id+'\',\''+renderId+'\','+startPage+','+endPage+')">'+i+'</a>';
	}
	str += nextPageStr;
	$('#'+renderId).html(str);
	if(!initFlag)
		$.get('information/information_findAllInformation.shtml?pageNo='+page+'&limit='+limit+'&categoryId='+id,function(mes){
			var json = eval('('+mes+')');
			var str = '';
			for(var i = 0; i < json.length; i++){
				str+='<div class="r-2"><nobr><a target="_blank" href="information/information_searchPingGouAndBrand.shtml?id='+json[i]['id']+'">[';
				if(json[i]['content']==''){
				  str+=json[i]['imgUrl'];
				}else{
                   str+=json[i]['content'];
				}
				str+=']'+json[i]['title']+'</a></nobr></div>';
			}
			$('#zxlb_'+id).html(str);
		})
}

function bulidPagnationChild(totalcount,limit,page,id,renderId,nowId,endId){
	var previewPageStr = '<span class="disabled">&lt;</span>';
	var nextPageStr = '<span><a href="#?page=2">&gt;</a></span>';
	var currentPageStr = '<span class="current">1</span>';
	var showPageStr = '<a href="#?page=2">2</a>';
	var totalPages = (totalcount + limit - 1) / limit;
	var startPage = nowId;
	var endPage = startPage+4;
	if(page>=4)
		if((page - nowId)>=3){
			startPage = page - 2;
			endPage = startPage + 4;
		} 
	if(nowId != 1)
		if((endId-page)>=3){
			startPage = page - 2;
			endPage = startPage + 4;
		}
	if(endPage > totalPages){
		endPage = totalPages;
		nextPageStr = '<span class="disabled">&gt;</span>';
	}else{
		nextPageStr = '<a href="javascript:bulidPagnationChild('+totalcount+','+limit+','+(page+1)+',\''+id+'\',\''+renderId+'\','+startPage+','+endPage+')">&gt;</a>';
	}
	if(startPage > 1){
		previewPageStr = '<a href="javascript:bulidPagnationChild('+totalcount+','+limit+','+(page-1)+',\''+id+'\',\''+renderId+'\','+startPage+','+endPage+')">&lt</a>';
	}
	var str = previewPageStr;
	for(var i = startPage;i <= endPage; i++){
		if(i == page)
			str += '<span class="current">'+i+'</span>';
		else
			str += '<a href="javascript:bulidPagnationChild('+totalcount+','+limit+','+(i)+',\''+id+'\',\''+renderId+'\','+startPage+','+endPage+')">'+i+'</a>';
	}
	str += nextPageStr;
	$('#'+renderId).html(str);
	if(!initFlag)
		$.get('information/information_findAllInformationChild.shtml?pageNo='+page+'&limit='+limit+'&categoryId='+id,function(mes){
			var json = eval('('+mes+')');
			var str = '';
			for(var i = 0; i < json.length; i++){
				str+='<div class="r-2"><nobr><a target="_blank" href="information/information_searchPingGouAndBrand.shtml?id='+json[i]['id']+'">[';
				if(json[i]['content']==''){
				  str+=json[i]['imgUrl'];
				}else{
                   str+=json[i]['content'];
				}
				str+=']'+json[i]['title']+'</a></nobr></div>';
			}
			$('#zxlb_'+id).html(str);
		})
}

</script>
		<link href="<%=basePath%>resource/css/css1.css" rel="stylesheet"
			type="text/css" />
	</head>
	<body id="top" onload="InitSwitchObj()">
			
			<div id="top-1">
				<div class="top-1-left">
					<a href="javascript:addfavorite()" title="收藏本站" id="topFlag">收藏本站</a>
				</div>
				<div class="top-1-right">
					<%
						TsSysuser tsSysuser = (TsSysuser) RequestUtil
								.getLoginUserFromSession(request, Contants.SESSION_USER);
						if (tsSysuser == null) {
					%>
					<div class="top-1-right">
						欢迎登录幸福兄弟拼购网！ |
						<a href="<%=basePath%>login.html" title="登录">登录</a> |
						<a href="<%=basePath%>user/goForWordRegister.shtml" title="免费注册">免费注册</a>
						|&nbsp;&nbsp;
					</div>
					<%
						} else {
					%>
					<div class="top-1-right">
						欢迎<%=tsSysuser.getUsername()%>登录幸福兄弟拼购网！ |
						<a href="<%=basePath%>loginsuccess.jsp" target="_top"
							title="个人管理">个人管理</a> |
						<a href="<%=basePath%>user/qiantanExit.shtml" title="退出登录">退出登录</a>
					</div>
					<%
						}
					%>
				</div>
			</div>
			<div id="top-2">
				 <table width="1000" border="0" cellspacing="0" cellpadding="0">
  <tr >
  <td>
    <table  border="0" cellspacing="0" cellpadding="0">
    <tr >
      <td width="79px" height="88">
      <div class="top-2-1"></div></td>
    <td width="10px">&nbsp;</td>
    <td width="157px" style="background:url(<%=basePath %>resource/img/index/logo4.jpg) no-repeat right;width:157px;">
    <div style="width:157px;"></div>
	</td>
     <td width="200px" style="background:url(<%=basePath %>resource/img/index/logo5.jpg) no-repeat left;" >
     <div style="padding-top:61px;height:25px;z-index:10" id="flexDiv">
     <object style="z-index:10" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="214" height="25">
        <param name="movie" value="<%=basePath %>resource/img/index/dh.swf"/>
        <param name="quality" value="high"/>
        <embed src="<%=basePath %>resource/img/index/dh.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="214" height="25">
        </embed>
        </object>
      </div>
    </td>
    </tr>
    <tr >
       <td colspan="4" style="background:url(<%=basePath %>resource/img/index/logo3.jpg) no-repeat left" align="left"><div class="top-2-2"><span style="color:#003366">拼购：</span>全城千万消费者聚在一起，哪个品牌商家敢不给我们最大的折扣？<br />
      <span style="color:#003366">拼购：</span>看得见的省钱，绝对让你省最多的钱！<br />
      <span style="color:#003366">拼购：</span>买最满意的产品！享受最称心的服务！<br />
      <span style="color:#003366">曝光维权：</span>商家如不讲诚信！<span style="color:#F00; font-weight:600; font-size:14px">800</span>万盐城人民助你讨回公道！</div></td>
    </tr>
    </table>
  </td>
  <td width="520px">
       <div id="indeximg" style="width:530px;height:170px">
      </div>
  </td>
  </tr>
  
</table>
			</div>
			<div id="menut">
				<table width="1000" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td
							style="background: url(<%=basePath%>resource/img/index/menu-1.jpg) no-repeat"
							width="5" height="52"></td>
						<td
							style="background: url(<%=basePath%>resource/img/index/menu-2.jpg) repeat-x"
							width="991">
							<div id="menu-left">
								<ul>
									<li>
										<a href="<%=basePath%>home.shtml"><span class="menu-left1">首
												页</span> </a>
									</li>
									<s:iterator value="#categoryList">
										<li
											class="menu_category <s:if test='%{#pid==id}'>selected</s:if>">
											<s:if test='%{#pid==id}'>
												<s:set name="currentPName" value="name"></s:set>
											</s:if>

											<a
												href="showCategory.shtml?categoryId=<s:property value="children.get(0).id"/>&pid=<s:property value="id" />"><span
												class="menu-left1 <s:if test='%{#pid==id}'>selected2</s:if>"><s:property
														value="name" /> </span> </a>
										</li>
									</s:iterator>
								</ul>
							</div>
							<div id="menu-right">
								<div class="sou-1">
									<div class="suo-left-1">
										<label for="select"></label>
										<select style="border:0px;" name="select" id="searchType">
											<option value="-1">
												请选择
											</option>
											<option value="1">
												拼购品牌
											</option>
											<option value="2">
												抢购产品
											</option>
										</select>
									</div>
									<div class="suo-left-2">
										<label for="textfield"></label>
										<input name="textfield" type="text" id="name"
											style="border: 0px; line-height: 20px; height: 20px; width: 185px; float: left" onkeydown="if(event.keyCode == 13) find();"/>
									</div>
								</div>
								<div class="sou-2">
									<a href="javascript:find()">搜索</a>
								</div>
							</div>

						</td>
						<td
							style="background: url(<%=basePath%>resource/img/index/menu-3.jpg) no-repeat"
							width="4" height="52"></td>
					</tr>
				</table>
			</div>
			
			<div id="con" >
				<ul id="tags">
					<s:iterator value="#categoryList" var="category">
						<s:if test="%{#category.id == #pid}">
							<s:iterator value="children" var="child">
								<s:if test="%{#child.id == #categoryId}">
									<li class="selectTag">
										<s:set name="currentMenuName"
											value="#child.name"></s:set>
										<s:set name="categoryName" value="#child.name"></s:set>
										<s:set name="categoryInfoCount"
											value="#child.informationCount"></s:set>
								</s:if>
								<s:else>
									<li>
								</s:else>
								<a
									href="javascript:selectTag('<s:property value="#child.id"/>','<s:property value="#category.id"/>')"><span
									class="bei"><s:property value="#child.name" /> </span> </a>
								</li>
							</s:iterator>
						</s:if>
					</s:iterator>
				</ul>
				<div id="tagContent">
					<div class="tagContent selectTag" id="tagContent0">
						<div id="gongao" class="gongao">
							<s:property value="#anno.content" escape="false"/>
						</div>
						<div id="con1" style="margin-top: 20px;">
							<ul id="markettags">
								<s:if test="%{#marketId != 0l}">
									<li>
								</s:if>
								<s:else>
									<li class="selectTag">
								</s:else>
								<a
									href="javascript:selectTag('<s:property value="#categoryId"/>','<s:property value="#pid"/>')"><span
									class="bei">全&nbsp;&nbsp;部</span>
								</a>|
								</li>
								<s:iterator value="#marketList" var="market">
									<s:if test="%{#marketId != #market.id}">
										<li>
									</s:if>
									<s:else>
										<li class="selectTag">
									</s:else>
									<a
										href="javascript:selectTag1('<s:property value="#categoryId"/>','<s:property value="#pid"/>','<s:property value="#market.id"/>')"><span
										class="bei"><s:property value="#market.name" />
									</span>
									</a>|</li>
								</s:iterator>
							</ul>
						</div>
						<div id="content1">
							<div id="left">
								<iframe id="contentFrame"
									src="<%=basePath%>showCategoryContentList.shtml?categoryId=<s:property value="#categoryId"/>&categoryName=<s:property value="#categoryName"/>&marketId=<s:property value="#marketId"/>"
									frameborder="0" scrolling="no" width="660px" ></iframe>
							</div>
							<div id="right">
								<div class="c-right-2">
									<div class="r-px1">
										<s:iterator value="#categoryList" var="category">
											<s:if test="%{#category.id == #pid}">
												<h1 style="padding-left: 15px;">
													<s:property value="name" />
													资讯
												</h1>
												<div class="yahoo"  
													id="zx_<s:property value="#category.id"/>">
													<script>bulidPagnation(parseInt('<s:property value="#category.informationCount"/>',10),16,1,'<s:property value='#category.id'/>','zx_<s:property value='#category.id'/>',1,5)</script>
												</div>
									</div>
									<div class="r-px3">
										<div class="r-tu">
											<div class='img-swith-main'>
												<div class="img-switch">
													<ul id="IMG_UL_LIST_1">
														<s:iterator value="#imgInfoList">
															<li>
																<a target="_blank"
																	href="information/information_searchPingGouAndBrand.shtml?id=<s:property value='id'/>"><img
																		src="<s:property value="imgUrl"/>" />
																</a>
															</li>
														</s:iterator>
													</ul>
												</div>
												<div class='img-switch-index'>
													<ul id="IMG_INDEX_UL_LIST_1">
														<s:iterator value="#imgInfoList" status="stat">
															<s:if test="#stat.index == 0">
																<li id="li_index_default1"
																	style="background-color: #aaa;">
															</s:if>
															<s:else>
																<li>
															</s:else>
																				0<s:property value="#stat.index+1" />
															</li>
														</s:iterator>
													</ul>
												</div>
												<div class='img-switch-clear'>
												</div>
											</div>
										</div>
										<div class="px320px-1"
											id="zxlb_<s:property value='#category.id'/>">
											<s:iterator value="#informationMap.get(#category.id)"
												status="stat">
												<s:if test="%{#stat.index / 16 == 0}">
													<div class="r-2">
														<nobr>
														<a target="_blank"  title="<s:property value="contentShort"	 />"
															href="<%=basePath%>information/information_searchPingGouAndBrand.shtml?id=<s:property value="id"/>">[<s:if test="content==null"><s:property value="imgUrl"/></s:if><s:else><s:property	value="content" /></s:else>]<s:property value="title"
													escape="false" />
															 </a>
														</nobr>
													</div>
												</s:if>
											</s:iterator>
										</div>
										<div class="r-tu1">
											<ul>
												<s:iterator value="#hotTrendCategory.get(#pid)">
													<li>
														<div class="r-tu2">
															<a target="_blank"
																href="brand/detailShoper.shtml?id=<s:property value="id" />&categoryId=<s:property value="cid" />"><img
																	src="<s:property value="imgsrc" />" width="98"
																	height="46" />
															</a>
														</div>
													</li>
												</s:iterator>
											</ul>
										</div>
									</div>
									</s:if>
									</s:iterator>
								</div>
								<div id="right-3">
									<div class="r-px1">
										<h1 style="padding-left: 15px;">
											<s:property value="#currentMenuName" />
											知识
										</h1>
										<div class="yahoo" id="zx_<s:property value="#categoryId"/>">
											<script>bulidPagnationChild(parseInt('<s:property value="#categoryinforCount"/>',10),16,1,'<s:property value='#categoryId'/>','zx_<s:property value='#categoryId'/>',1,5)</script>
										</div>
									</div>
									<div class="r-px3-1">
										<div class="px320px-2" id="zxlb_<s:property value='#categoryId'/>">
											<s:iterator value="#categoryInfoList">
												<div class="r-2">
													<nobr>
													<a target="_top"  title="<s:property value="contentShort"	 />"
														href="<%=basePath%>information/information_searchPingGouAndBrand.shtml?id=<s:property value="id"/>">[<s:property
															value="content" />]<s:property value="title"
															escape="false" /> </a>
													</nobr>
												</div>
											</s:iterator>
										</div>
										<div class="r-tu1" >
											<ul>
												<s:iterator value="#categoryTrend.list">
													<li>
														<div class="r-tu2">
															<a target="_blank"
																href="brand/detailShoper.shtml?id=<s:property value="id" />&categoryId=<s:property value="cid" />"><img
																	src="<s:property value="imgsrc" />" width="98"
																	height="46" />
															</a>
														</div>
													</li>
												</s:iterator>
											</ul>
										</div>
									</div>

								</div>

							</div>
						</div>
					</div>
				</div>
			</div>
			<iframe src="<%=basePath%>index/footer.html" frameborder="0"
				scrolling="no" width="100%" ; height="90px;"></iframe>

			<script type="text/javascript">
function selectTag(showContent,selfObj){
	window.location.href = "<%=basePath%>showCategory.shtml?categoryId="+showContent+'&pid='+selfObj;
}

function selectTag1(showContent,selfObj,marketId){
	window.location.href = "<%=basePath%>showCategory.shtml?categoryId="+showContent+'&pid='+selfObj+'&marketId='+marketId;
}

 function  find(){
        
        var sv= document.getElementById("searchType");
         var name= document.getElementById("name");
        if("-1"==sv.value)
        { 
          alert("请选择搜索类型");
          sv.focus();
          return;
        }
        if(""==name.value)
        { 
          alert("请输入搜索关键词");
          name.focus();
          return;
        }
         window.location.href="<%=basePath%>search.shtml?name="+encodeURIComponent(name.value)+"&type="+sv.value;
        
     
    }
        initFlag = false;
  
  	document.title = '<s:property value="#currentPName"/>'+	document.title; 
  	
  	function setFRHeight(height){
  		jQuery('#contentFrame').height(height);
  	}
  	
  	
  	jQuery.get('indexImg.shtml',function(mes){
			if(mes != "" && mes != "[null]"){
				var json = eval('('+mes+')');
				var str = '<a target="_blank" href="information/information_searchPingGouAndBrand.shtml?id='+json[0]['id']+'"><img src="'+json[0]['imgUrl']+'" style="width:530px;height:170px"/>';
				jQuery('#indeximg').html(str);
			}
		})
</script>

	</body>
</html>

